#include <fmt/core.h>
#include <bit7z/bit7z.hpp>
#include <iostream>

namespace superunzip::utils
{
    void extract7Zip(const std::string &zip_path, const std::string &out_dir)
    {
        bit7z::Bit7zLibrary lib("7z.dll");
        bit7z::BitFileExtractor extractor(lib, bit7z::BitFormat::SevenZip);

        extractor.setFileCallback([](std::string fileName)
                                  { fmt::println("处理: {}", fileName.c_str()); });

        extractor.extract(zip_path.c_str(), out_dir.c_str());
    }
}
